<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>课程信息系统</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="assets/css/admin.css">
    <link rel="stylesheet" href="assets/css/app.css">
    <link rel="stylesheet" href="assets/css/pagination.css">
</head>

<body data-type="index">
    <header class="am-topbar am-topbar-inverse admin-header">
        <div class="am-topbar-brand">
            <a href="index.html" class="tpl-logo">
                <img src="assets/img/logo.png" alt="">
            </a>
        </div>
        <div class="am-icon-list tpl-header-nav-hover-ico am-fl am-margin-right">
        </div>
        <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}">
            <span class="am-sr-only">导航切换</span>
            <span class="am-icon-bars"></span>
        </button>
        <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
            <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list tpl-header-list">
                <li class="am-hide-sm-only">
                    <a href="javascript:;" id="admin-fullscreen" class="tpl-header-list-link">
                        <span class="am-icon-arrows-alt"></span>
                        <span class="admin-fullText">开启全屏</span>
                    </a>
                </li>
                <li class="am-dropdown" data-am-dropdown data-am-dropdown-toggle>
                    <a class="am-dropdown-toggle tpl-header-list-link" href="javascript:;">
                        <span class="tpl-header-list-user-nick">管理员</span>
                        <span class="tpl-header-list-user-ico">
                            <img src="assets/img/user01.png">
                        </span>
                    </a>
                    <ul class="am-dropdown-content">
                        <li><a class="logout"><span class="am-icon-power-off"></span> 退出</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </header>
    <div class="tpl-page-container tpl-page-header-fixed">
        <div class="tpl-left-nav tpl-left-nav-hover" style="height:600px">
            <div class="tpl-left-nav-title">
                用户中心
            </div>
            <div class="tpl-left-nav-list">
                <ul class="tpl-left-nav-menu">
                    <li class="tpl-left-nav-item">
                        <a href="index.html" class="nav-link ">
                            <i class="am-icon-home"></i>
                            <span>首页</span>
                        </a>
                    </li>
                    <li class="tpl-left-nav-item">
                        <a href="course_mess.html" class="nav-link tpl-left-nav-link-list">
                            <i class="am-icon-bar-chart"></i>
                            <span>课程信息</span>
                            <!--  <i class="tpl-left-nav-content tpl-badge-danger"></i> -->
                        </a>
                    </li>
                    <li class="tpl-left-nav-item">
                        <a href="stu_mess.html" class="nav-link tpl-left-nav-link-list active">
                            <i class="am-icon-bar-chart"></i>
                            <span>学生信息</span>
                            <!--  <i class="tpl-left-nav-content tpl-badge-danger"></i> -->
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
                课程信息系统
            </div>
            <ol class="am-breadcrumb">
                <li>
                    <a href="#" class="am-icon-home">首页</a>
                </li>
                <li>
                    <a href="#">统计信息</a>
                </li>
            </ol>
            <div class="tpl-portlet-components" style="overflow-y: scroll">

                <div class="am-g" style="">
                    <div class="row" style="height:500px;background: #fff;overflow-y: scroll">
                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                                <tr>
                                    <th class="">学生编号</th>
                                    <th class="">学生姓名</th>
                                    <th class="">课程门数</th>
                                    <th class="">讲座数</th>
                                    <th class="">专题数</th>
                                </tr>
                            </thead>
                            <tbody class="stu_mess">
                                <!-- <tr>
                                    <td>14</td>
                                    <td>
                                        <a href="#">Business management</a>
                                    </td>
                                    <td onclick="courseDetail()">12门</td>
                                    <td onclick="lectureDetail()" class="am-hide-sm-only">测试14号</td>
                                    <td onclick="topicDetail()" class="am-hide-sm-only">2014年9月4日 7:28:47</td>
                                </tr>
                                <tr>
                                    <td>15</td>
                                    <td>
                                        <a href="#">Business management</a>
                                    </td>
                                    <td>default</td>
                                    <td class="am-hide-sm-only">测试1号</td>
                                    <td class="am-hide-sm-only">2014年9月4日 7:28:47</td>
                                </tr>
 -->                            </tbody>
                        </table>
                    </div>

                </div> <div class="M-box" id="pagination"></div>
            </div>
        </div>
    </div>
    <!-- 模态框 -->
    <div class="am-popup" id="my-popup">
        <div class="am-popup-inner">
            <div class="am-popup-hd">
                <h4 class="am-popup-title">课程记录</h4>
                <span data-am-modal-close class="am-close">&times;</span>
            </div>
            <div class="am-popup-bd">
                <table class="am-table am-table-striped am-table-hover table-main course_detail">
                    <tr>
                        <th class="">专题名称</th>
                        <th class="">总课程</th>
                        <th class="">收藏数</th>
                    </tr>
                    <tbody>
                        <tr>
                            <td>14</td>
                            <td>9.7</td>
                            <td>default</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/js/amazeui.min.js"></script>
    <script src="assets/js/app.js"></script>
    <script src="assets/js/raty/jquery.ratyli.min.js"></script>
    <script src="common/jquery.pagination.js"></script>
    <script>
    var totalPage = 1; //总共多少页  
    var totalRecords = 1; //总共多少条  
    var pageSize = 10; //每页显示多少页
    loadList(1);

    function loadList(pno) {

        $.ajax({
            type: "get",
            url: "/admin/userInfo/pageCount/" + pno + "/pageSize/" + pageSize,
            dataType: "json",
            success: function(result) {

                // if (result.success) {  
                var count = result.totalCount;
                //var data = result.rows;  
                totalRecords = count;
                totalPage = Math.ceil(count / pageSize);
                var datalist = "";
                $.each(result.data, function(i, item) {
                    datalist +=
                        ' <tr><td>' + item.authorId + '</td><td>' + item.authorName + '</td><td style="cursor:pointer" onclick="courseDetail(\'' + item.authorName + '\')">' + item.courseNumber + '</td><td style="cursor:pointer" onclick="lectureDetail(\'' + item.authorId + '\')">' + item.lectureNumber + '</td><td style="cursor:pointer" onclick="topicDetail(\'' + item.authorId + '\')">' + item.topicNumber + '</td></tr>';

                })
                $(".stu_mess").html(datalist);
                $('.ratyli').ratyli({
                    disable: true
                });
                $('.M-box').pagination({
                    pageCount: totalPage,
                    current: pno, //当前第几页  
                    jump: true,
                    coping: true,
                    homePage: '首页',
                    endPage: '末页',
                    prevContent: '上页',
                    nextContent: '下页',
                    callback: PageClick
                });
            }
        });
    }
    //回调函数    
    PageClick = function(index) {
        //$('.now').text(index.getCurrent());   
        loadList(index.getCurrent()); //点击分页加载列表数据   
    }


    //详情课程查询
    function courseDetail(id) {
        var data = {
            authorName: id
        }
        //console.log(data);
        $("#my-popup").modal();
        $.ajax({
            type: "get",
            data: data,
            url: "/admin/userStudyCourse/pageCount/1/pageSize/100",
            dataType: "json",
            success: function(result) {

                // if (result.success) {  
                var count = result.totalCount;
                //var data = result.rows;  
                totalRecords = count;
                totalPage = Math.ceil(count / pageSize);
                var datalist = ' <thead><tr><th class="">课程名称</th><th class="">课程评分</th><th class="">难易程度</th><th class="">知识量</th><th class="">课程标签</th><th class="">教师参与度</th></tr></thead><tbody>';
                $.each(result.data, function(i, item) {
                    datalist +=
                        '<tr><td>' + item.courseNameCn + '</td><td>' + item.score + '</td><td>' + item.courseLevel + '</td><td class="am-hide-sm-only">' + item.knowledgeV + '</td><td class="am-hide-sm-only">' + item.commentTag + '</td><td class="am-hide-sm-only">' + item.teacherV + '</td></tr></tbody>';
                })
                console.log(datalist)
                $(".course_detail").html(datalist);
                /*$('.ratyli').ratyli({
                    disable: true
                });
                $('.M-box').pagination({
                    pageCount: totalPage,
                    current: pno, //当前第几页  
                    jump: true,
                    coping: true,
                    homePage: '首页',
                    endPage: '末页',
                    prevContent: '上页',
                    nextContent: '下页',
                    callback: PageClick
                });*/
            }
        });
    }
    //详细演讲查询
    function lectureDetail(id) {
        var data = {
            authorId: id
        }
        $("#my-popup").modal();
        $.ajax({
            type: "get",
            data: data,
            url: "/admin/userLecture/pageCount/1/pageSize/100",
            dataType: "json",
            success: function(result) {

                // if (result.success) {  
                var count = result.totalCount;
                //var data = result.rows;  
                totalRecords = count;
                totalPage = Math.ceil(count / pageSize);
                var datalist = ' <thead><tr><th class="">演讲id</th><th class="">演讲名称</th></tr></thead><tbody>';
                $.each(result.data, function(i, item) {
                    datalist +=
                        '<tr><td>' + item.lectureId + '</td><td>' + item.lecture + '</td></tr></tbody>';
                })
                $(".course_detail").html(datalist);
                /*$('.ratyli').ratyli({
                    disable: true
                });
                $('.M-box').pagination({
                    pageCount: totalPage,
                    current: pno, //当前第几页  
                    jump: true,
                    coping: true,
                    homePage: '首页',
                    endPage: '末页',
                    prevContent: '上页',
                    nextContent: '下页',
                    callback: PageClick
                });*/
            }
        });
    }

    //详情专题查询
    function topicDetail(id) {
        var data = {
            authorId: id
        }
        $("#my-popup").modal();
        $.ajax({
            type: "get",
            data: data,
            url: "/admin/userTopic/pageCount/1/pageSize/100",
            dataType: "json",
            success: function(result) {

                // if (result.success) {  
                var count = result.totalCount;
                //var data = result.rows;  
                totalRecords = count;
                totalPage = Math.ceil(count / pageSize);
                var datalist = ' <thead><tr><th class="">专题名称</th><th class="">总课程</th><th class="">收藏数</th></tr></thead><tbody>';
                $.each(result.data, function(i, item) {
                    datalist +=
                        '<tr><td>' + item.zoneTxtTitle + '</td><td>' + item.zoneTxtNum + '</td><td>' + item.zoneCollect + '</td></tr></tbody>';
                })
                $(".course_detail").html(datalist);
                /*$('.ratyli').ratyli({
                    disable: true
                });
                $('.M-box').pagination({
                    pageCount: totalPage,
                    current: pno, //当前第几页  
                    jump: true,
                    coping: true,
                    homePage: '首页',
                    endPage: '末页',
                    prevContent: '上页',
                    nextContent: '下页',
                    callback: PageClick
                });*/
            }
        });
    }
    </script>
</body>

</html>